
//侧边边栏
var mpName = document.querySelectorAll(".nav_l_lsf ul li");
var len = mpName.length;
var index = 0;
for (var i = 0; i < len; i++) {
  mpName[i].addEventListener("mouseenter", function () {
    this.className = "nav-l-lsf-act";
  });
  mpName[i].addEventListener("click", function (e) {
    for (var j = 0; j < len; j++) {
      mpName[j].className = "";
    }
    this.className = "nav-l-lsf-act";
    index = e.target.getAttribute("data-index");
  });
  mpName[i].addEventListener("mouseleave", function () {
    this.className = "";
    mpName[index].className = "nav-l-lsf-act";
  });
}

// var index = e.target.getAttribute("data-index"); //加强记着
// mpName[index].className = "nav-l-lsf-act"

//人物图片移动
var rw_lsf = document.querySelector('.rw_lsf')
var rw_lsfimg = document.querySelector(".rw_lsf > img");
rw_lsf.addEventListener("mouseenter", function () {
  rw_lsfimg.style.left = '-270px'
});
rw_lsf.addEventListener("mouseleave", function () {
  rw_lsfimg.style.left = "-250px";
});

//技能
var skill = document.querySelectorAll(".skill-table>div");
var mpbox = document.querySelector(".mp-det-lsf > .mpbox" );
skill[0].onclick = function () {
  skill[0].className = 'left act'
  skill[1].className = 'left'
  mpbox.className = "mpbox";
}
skill[1].onclick = function () {
  skill[0].className = "left ";
  skill[1].className = "left act";
  mpbox.className= 'mpbox mpboxtranslateX'
};
var btn = document.querySelector(".btn_ofnav_lsf");
var r_table_lsf = document.querySelector('.r_table_lsf')
var btn_img = document.querySelector(".btn_ofnav_lsf>img");
var falst = true
btn.addEventListener('click' ,function() {
  if (falst) {
    r_table_lsf.style.right = '-355px'
    falst = false
    btn_img.className = "btn_img_fz";
  }else {
    r_table_lsf.style.right = '0'
    falst = true
    btn_img.className = ''
  }
})